// pages/center/center.js
var list1 = '../follow/follow'
var about = '../about/about'
var renzheng = '../renzheng/renzheng'
var set = '../set/set'
var recharge = '../recharge/recharge'
var app = getApp()
Page({
  data:{
    userInfo: {},
    set: [
      {
        first: "first",
        tag: "follow",
        name: "关注"
      },
      {
        tag: "recharge",
        name: "我的账户"
      },
      {
        tag: "renzheng",
        name: "实名认证"
      },
      {
        tag: "set",
        name: "设置"
      },
      {
        tag: "about",
        name: "关于"
      },
    ]
  },
  follow: function() {
      wx.navigateTo({
        //传递参数方式向get请求拼接参数一样
        url:  list1 + '?phone=18939571&password=1992',
        success: function(res) {
          console.log(res)
        },
        fail: function(err) {
          console.log(err)
        }

      })
  },
  set: function() {
      wx.navigateTo({
        //传递参数方式向get请求拼接参数一样
        url:  set + '?phone=18939571&password=1992',
        success: function(res) {
          console.log(res)
        },
        fail: function(err) {
          console.log(err)
        }

      })
  },
  recharge: function() {
      wx.navigateTo({
        //传递参数方式向get请求拼接参数一样
        url:  recharge + '?phone=18939571&password=1992',
        success: function(res) {
          console.log(res)
        },
        fail: function(err) {
          console.log(err)
        }

      })
  },
  about: function() {
      wx.navigateTo({
        //传递参数方式向get请求拼接参数一样
        url:  about + '?phone=18939571&password=1992',
        success: function(res) {
          console.log(res)
        },
        fail: function(err) {
          console.log(err)
        }

      })
  },
  renzheng: function() {
      wx.navigateTo({
        //传递参数方式向get请求拼接参数一样
        url:  renzheng + '?phone=18939571&password=1992',
        success: function(res) {
          console.log(res)
        },
        fail: function(err) {
          console.log(err)
        }

      })
  },
  onLoad: function () {
    var that = this
    //调用应用实例的方法获取全局数据
    app.getUserInfo(function(userInfo){
      //更新数据
      that.setData({
        userInfo:userInfo
      })
      console.log(userInfo);
    })
  },
  onReady:function(){
    // 页面渲染完成
  },
  onShow:function(){
    // 页面显示
  },
  onHide:function(){
    // 页面隐藏
  },
  onUnload:function(){
    // 页面关闭
  }
})